#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>

int main()
{
    close(1);

    int fd=open("log.txt",O_WRONLY|O_APPEND|O_CREAT);
    if(fd<0)
    {
        perror("open");
        return 1;
    }
    fprintf(stdout,"you can see me\n");

    return 0;
}
